﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using ttg_internal.Utilities.PipelineManager.Helpers;
using ttg_internal.utils;

namespace ttg_internal.Utilities.PipelineManager.Converters
{
    public class PipelineConverter : DependencyObject, IValueConverter
    {
        /// <summary>
        /// Converts a value. 
        /// </summary>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return null;
            }

            Debug.Assert(value is IEnumerable<Node>);
            return new NodesCollectionConverter(Dispatcher, (IEnumerable<Node>)value);
        }

        /// <summary>
        /// Converts a value. 
        /// </summary>
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
